
#ifndef _VIEWPORT_H_
#define _VIEWPORT_H_

#include "LibraryEngineExport.h"
#include "Maths/Vector3.h"
#include "Maths/Matrix4.h"

namespace CasaEngine
{
	///
	class LIBRARY_ENGINE_EXPORT Viewport
	{
	public:
		Viewport();
		Viewport(int x, int y, int width, int height);
		const Viewport& operator = (const Viewport& rsh_);
		~Viewport();

		int X() const;
		void X(int val);
		int Y() const;
		void Y(int val);
		int Width() const;
		void Width(int val);
		int Height() const;
		void Height(int val);
		float MinDepth() const;
		void MinDepth(float val);
		float MaxDepth() const;
		void MaxDepth(float val);
		float AspectRatio() const;		

		Vector3F Project(Vector3F source, Matrix4 projection, Matrix4 view, Matrix4 world);
		Vector3F Unproject(Vector3F source, Matrix4 projection, Matrix4 view, Matrix4 world);

	private:

		void ComputeAspectRatio();

	private:

		int m_iX;		
		int m_iY;		
		int m_iWidth;		
		int m_iHeight;		
		float m_fminDepth;		
		float m_fmaxDepth;		
		float m_fAspectRatio;		
	};

}  // namespace CasaEngine

#endif //GAMETIME_H
